package com.iris.live.services.data.repositories;

import com.iris.live.services.data.models.Lsh金融机构设置Model;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Created by sxy on 2016/7/11.
 */
public interface Lsh金融机构设置Repository extends JpaRepository<Lsh金融机构设置Model, Integer>, JpaSpecificationExecutor<Lsh金融机构设置Model> {

    @Query("select a from Lsh金融机构设置Model a where a.许可 = ?1 and a.金融机构 = ?2")
    Lsh金融机构设置Model getModelByPermitAndCompanyName(String permit, String companyName);

    @Query(value = "select 金融机构 from Lsh金融机构设置 where 状态 = '启用' and 金融机构 is not null  and 金融机构 <> ''  group by 金融机构 ",nativeQuery = true)
    List<String> getFinanceOrgList();
}
